package com.wysql.iostream;

import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Properties;
import java.util.Set;

public class Prop {
    public static void main(String[] args) throws IOException {



        Properties prop1 = new Properties();
        prop1.put("age","18");
        prop1.put("age1","109");
        FileWriter fileWriter = new FileWriter("IOstream/src/filebook/prop.properties",true);
        prop1.store(fileWriter,"增补属性");
        fileWriter.close();

        Properties prop2 = new Properties();
        prop2.put("age2","18");
        prop2.put("age3","109");
        FileWriter fileWriter1 = new FileWriter("IOstream/src/filebook/prop.properties",true);
        prop2.store(fileWriter1,"增补属性1");
        fileWriter1.close();

        Properties prop = new Properties();
        FileReader fileReader = new FileReader("IOstream/src/filebook/prop.properties");
        prop.load(fileReader);
        fileReader.close();



        Set<String> keys = prop.stringPropertyNames();
        for (String key : keys) {
            String value = prop.getProperty(key);
            System.out.println(key + "=" + value);
        }
    }
}
